<?php if (!defined('THINK_PATH')) exit();?>    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <title></title>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/category.css" />
    <script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript">
        var ACTION = "__URL__";
    </script>
    <script type="text/javascript" src="__PUBLIC__/Admin/js/category.js"></script>
</head>
<body>

		
        <form action="<?php echo U('addItem');?>" method="post">
            <h2>
                <a>所在位置：商品管理>货品列表</a>
            </h2>
            <br/>
           <table class="table1">
            <thead>
                <tr style="background:#72A9D3">
                    <th width="60" align="center">货品ID</th>
                    <?php if(is_array($typeName)): foreach($typeName as $key=>$val): ?><th><?php echo ($val["name"]); ?></th><?php endforeach; endif; ?>
                    <th>库存</th>
                    <th>货号</th>
                    <th width="400">操作</th>
                </tr>
            </thead>
            <tbody>
                <?php if(is_array($itemslist)): foreach($itemslist as $key=>$val): ?><tr class="catgorylist">
                    <td align="center"><?php echo ($val["id"]); ?></td>
                    <?php if(is_array($val["attr"])): foreach($val["attr"] as $key=>$v): ?><td><?php echo ($v["value"]); ?></td><?php endforeach; endif; ?>
                    <td><?php echo ($val["inventory"]); ?></td>
                    <td><?php echo ($val["number"]); ?></td>
                    <td>
                        <a href="<?php echo U('editCategory',array('cid'=>$n['id']));?>">编辑该货品</a> |
                        <a href="javascript:void(0)" class="delcategory" cid="<?php echo ($n["id"]); ?>">删除该货品</a>
                    </td>
                </tr><?php endforeach; endif; ?>
                <tr>
                    <td>添加货品></td>
                    <?php if(is_array($spec)): foreach($spec as $key=>$val): ?><td>
                            <select name="attr[]">
                                <option value="0">--请选择--</option>
                                <?php if(is_array($val)): foreach($val as $key=>$v): ?><option value="<?php echo ($v["id"]); ?>"><?php echo ($v["value"]); ?></option><?php endforeach; endif; ?>
                            </select>
                        </td><?php endforeach; endif; ?>
                    <td>
                        <input type="text" name="inventory">
                    </td>
                     <td>
                        <input type="text" name="number">
                    </td>
                    <td>
                        <input type="hidden" name="gid" value="<?php echo ($_GET['gid']); ?>">
                        <input type="submit" value="添加货品" class="bt1">
                    </td>
                </tr>
                <?php if($itemCounts > 0): ?><tr>
                        <td colspan="<?php echo ($pageColspan); ?>" align="center"><?php echo ($page); ?></td>
                    </tr><?php endif; ?>
            </tbody>
        </table>
    </form>
</body>
</html>